<!DOCTYPE html>
<html>
<head>
  <title>JFormDesigner Examples README</title>
  <style type="text/css">

body {
	margin: 1cm;
	font-family: sans-serif;
	font-size: 14px;
	line-height: 21px;
	color: #444;
}

h1 {
	font-weight: 200;
	font-size: 36px;
	line-height: 42px;
}

h2 {
	border-bottom: 1px solid #ccc;
	font-weight: normal;
	font-size: 24px;
	line-height: 30px;
}

h3 {
	border-bottom: 1px solid #ddd;
	font-weight: normal;
	font-size: 18px;
	line-height: 24px;
}

h4 {
	border-bottom: 1px solid #eee;
	font-weight: normal;
	font-size: 16px;
	line-height: 22px;
}

a {
	color: #53915b;
	ext-decoration: none;
}

a:hover {
	color: #dd6900;
	text-decoration: underline;
}

pre {
	border: 1px solid #e8e8d8;
	border-radius: 3px;
	background: #f8f8f0;
	padding: 14px;
}

pre code {
	font-family: Consolas, monospace;
	font-size: 12px;
	line-height: 18px;
}

.key {
	color: #0099FF;
	font-weight: bold;
}

.edition {
	color: #990000;
	font-weight: bold;
}

.platform {
	color: #660000;
	font-style: italic;
}

.fd-install-path {
	text-decoration: underline;
}

.fd-install-instr strong {
	background-color: #f8f8f0;
}

.fd-install-instr pre {
	padding: 3px 5px;
	margin-bottom: 5px;
	margin-top: 5px;
	font-size: 12px;
	line-height: 14px;
}

.fd-licenses pre {
	background: #fcfcf9;
}

.fd-example-main {
	padding: 3px 6px;
	background-color: #f8f8f0;
	font-size: 12px;
}

  </style>


</head>

<body>
<div style="max-width: 50em;">
<h1>JFormDesigner Examples README</h1>
<h2>Introduction</h2>
<p>This folder contains example source code and forms.</p>
<p>To try this examples, create a new IDE project in this folder and
add <code>src</code> to the source folders of the project. Because
some of the examples require <code>jfd-annotations.jar</code>, <code>jfd-loader.jar</code>
or <code>beansbinding.jar</code>, add them to the build path of the
project. You'll find the libraries in the JFormDesigner's
<a href="https://www.formdev.com/jformdesigner/doc/examples-redist/#redist"><code>redist</code></a>
folder.</p>
<h2>Package com.jformdesigner.examples.basic</h2>
<ul>
<li><strong>CodeGenExample.java/.jfd</strong>: Demonstrates the use of the
JFormDesigner generated code.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
<li><strong>LoaderExample.java/.jfd</strong>: Demonstrates the use of the
JFormDesigner <a href="https://www.formdev.com/jformdesigner/doc/runtime-library/">form loader</a> API.
Requires <code>jfd-loader.jar</code> to load forms at runtime.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
</ul>
<h2>Package com.jformdesigner.examples.beans</h2>
<p>Some custom components that demonstrate use of
<a href="https://www.formdev.com/jformdesigner/doc/annotations/">JFormDesigner Annotations</a>
and implementation of BeanInfo classes that use JFormDesigner
<a href="https://www.formdev.com/jformdesigner/doc/java-beans/#beandesc_attrs">BeanDescriptor</a>
and <a href="https://www.formdev.com/jformdesigner/doc/java-beans/#propdesc_attrs">PropertyDescriptor Attributes</a>.</p>
<ul>
<li><strong>ContainerDelegateDemoPanel.java</strong>: A panel that demonstrates
the use of container delegates. It has own components and a content
pane, where you can add more components in JFormDesigner. To test this
panel, create a form and use &quot;Choose Bean&quot; to add this panel to the
form. You'll see the components of this panel and can add additional
components (in JFormDesigner) to the content pane.</li>
<li><strong>JBackgroundImagePanel.java</strong>: A panel that paints an image
on the background. Demonstrates the use of
<a href="https://www.formdev.com/jformdesigner/doc/annotations/">JFormDesigner Annotations</a>.</li>
<li><strong>JGradientPanel.java</strong>: A panel that paints a gradient
background from &quot;background&quot; color to &quot;background2&quot; color using the
specified direction and magnitude. Demonstrates the use of
<a href="https://www.formdev.com/jformdesigner/doc/annotations/">JFormDesigner Annotations</a>.</li>
<li><strong>JGradientPanelBIC.java</strong>: This class is equal to <code>JGradientPanel</code>
but uses a traditional BeanInfo class (BIC) <code>JGradientPanelBICBeanInfo.java</code>
instead of annotations. Demonstrates the implementation of a BeanInfo
class that uses JFormDesigner
<a href="https://www.formdev.com/jformdesigner/doc/java-beans/#beandesc_attrs">BeanDescriptor</a> and
<a href="https://www.formdev.com/jformdesigner/doc/java-beans/#propdesc_attrs">PropertyDescriptor Attributes</a>.</li>
<li><strong>JBaseDialog.java/.jfd</strong>: A base dialog that can be used as
superclass for own dialogs. It includes a button bar (OK, Cancel and
Help), adds a listener for the ESC key that closes the dialog and
handles closing from window manager (e.g. 'x' in window title).</li>
<li><strong>JSplitPaneWithZeroSizeDivider.java</strong>: A JSplitPane that uses
a 1 pixel thin visible divider, but a 9 pixel wide transparent drag
area.</li>
<li><strong>JSplitPaneWithZeroSizeDividerDemo.java</strong>: Demonstrates
JSplitPaneWithZeroSizeDivider.</li>
<li><strong>MyDialog.java/.jfd</strong>: Demonstrates the use of <code>JBaseDialog</code>.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
</ul>
<h2>Package com.jformdesigner.examples.beansbinding.clienteditor</h2>
<p>An example, ported from NetBeans to JFormDesigner, for using
<a href="https://www.formdev.com/jformdesigner/doc/ui/beans-binding/">Beans Binding</a> (JSR 295).
Uses binding <a href="https://doc.formdev.com/beansbinding/org/jdesktop/beansbinding/Converter.html">converters</a>
and <a href="https://doc.formdev.com/beansbinding/org/jdesktop/beansbinding/Validator.html">validators</a>.</p>
<ul>
<li><strong>AgeConverter.java</strong>: <code>Integer</code> to <code>String</code>
converter that returns zero when the argument cannot be parsed.</li>
<li><strong>AgeValidator.java</strong>: Validator that ensures that given value
is between 1 and 199.</li>
<li><strong>Client.java</strong>: Information about one client.</li>
<li><strong>ClientEditor.java/.jfd</strong>: Form that allows editing of
information about one client.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
<li><strong>EmailValidator.java</strong>: Validator that ensures that given
string is an e-mail address.</li>
<li><strong>LoggingBindingListener.java</strong>: Binding listener used to log
synchronization events. It displays (in given label) warnings for
failed synchronizations.</li>
<li><strong>MaritalStatusConverter.java</strong>: Converter between marital
status code and its human-readable representation.</li>
<li><strong>RequiredStringValidator.java</strong>: Validator that ensures that
given string is not empty.</li>
</ul>
<h2>Package com.jformdesigner.examples.beansbinding.simple</h2>
<p>A simple example for using <a href="https://www.formdev.com/jformdesigner/doc/ui/beans-binding/">Beans Binding</a> (JSR 295).</p>
<ul>
<li><strong>SimpleBindingDemo.java/.jfd</strong>: This is a very basic example of using
<a href="https://www.formdev.com/jformdesigner/doc/ui/beans-binding/">Beans Binding</a>
(JSR 295) to bind GUI components to a data object. The
components &quot;Value 1&quot; and &quot;Value 2&quot; are bound to &quot;simpleData&quot; object
fields. The components &quot;Copy of Value 1&quot; and &quot;Copy of Value 2&quot; are also
bound to &quot;simpleData&quot;. Initially, the values of &quot;simpleData&quot; are copied
to the GUI components. Changes in the GUI components are copied back to
&quot;simpleData&quot;, which fires events to inform others. So if you change
&quot;Value 1&quot;, the value is copied to &quot;simpleData.value1&quot; and then copied
to &quot;Copy of Value 1&quot;.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
<li><strong>SimpleData.java</strong>: Demo data model class used in <code>SimpleBindingDemo.java/.jfd</code>.</li>
</ul>
<h2>Package com.jformdesigner.examples.beansbinding.taskmanager</h2>
<p>Advanced example for using <a href="https://www.formdev.com/jformdesigner/doc/ui/beans-binding/">Beans Binding</a> (JSR 295).</p>
<ul>
<li><strong>TaskView.java/.jfd</strong>:&nbsp;This view shows/edits a single
task.
It uses <a href="https://www.formdev.com/jformdesigner/doc/ui/beans-binding/">Beans Binding</a>
to bind the properties of <code>task</code> to input
fields. Beans Binding is also used to enable/disable the input fields.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
<li><strong>TasksView.java/.jfd</strong>: This view shows a list of tasks in a <code>JTable</code>
and provides New, Edit and Delete buttons to edit the tasks. It uses
<a href="https://www.formdev.com/jformdesigner/doc/ui/beans-binding/">Beans Binding</a>
to bind the list of <code>tasks</code> to the <code>JTable</code>.
Beans Binding is also used to enable/disable the Edit and Delete
buttons based on selection. The New and Edit buttons use class <code>TaskView</code>
to show/edit the selected task in a sub-dialog.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
<li><strong>TasksEmbeddedView.java/.jfd</strong>: This view shows a list of
tasks
in a <code>JTable</code>, the selected task in an embedded <code>TaskView</code>
and provides New and Delete buttons to edit the tasks. It uses
<a href="https://www.formdev.com/jformdesigner/doc/ui/beans-binding/">Beans Binding</a>
to bind the list of <code>tasks</code> to the <code>JTable</code>
and the selected task to the embedded <code>TaskView</code>. Beans
Binding is also used to enable/disable the Delete button based on
selection. The New button uses <code>TaskView</code> to edit a new
task in a sub-dialog.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
<li><strong>Task.java</strong>: Task data model class. It has getter and setter
methods to access property values and supports property change
listeners thru class <code>AbstractModelObject</code>.</li>
</ul>
<h2>Package com.jformdesigner.examples.formmodel</h2>
<p>Examples for using <a href="https://www.formdev.com/jformdesigner/doc/runtime-library/">JFormDesigner Runtime Library</a>
to dynamically create JFormDesigner forms (*.jfd).
All examples in this package require <code>jfd-loader.jar</code>.</p>
<ul>
<li><strong>CreateFormLayoutFormExample.java</strong>: Demonstrates how to use
the JFormDesigner form model API and form saver API to dynamically
create a form file from a list of properties using
<a href="https://www.formdev.com/jformdesigner/doc/layouts/formlayout/">FormLayout</a>.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
<li><strong>CreateGridBagLayoutFormExample.java</strong>: Demonstrates how to
use the JFormDesigner form model API and form saver API to dynamically
create a form file from a list of properties using
<a href="https://www.formdev.com/jformdesigner/doc/layouts/gridbaglayout/">GridBagLayout</a>.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
<li><strong>DumpFormFile.java</strong>: Loads JFormDesigner form files (*.jfd)
and dumps the content. Demonstrates the use of the JFormDesigner form
loader API.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
<li><strong>FormSaverExamples.java</strong>: Demonstrates how to use the
JFormDesigner form model API and form saver API to create form files
using various layout managers. It creates in-memory form models and
saves them to .jfd files.<br />
<span class="fd-example-main">Run the <code>main()</code> method of this file to test this example.</span></li>
</ul>
<h2>Package com.jformdesigner.examples.i18n.xml</h2>
<p>Examples for using XML resource bundles.</p>
<ul>
<li><strong>I18nXmlExample.java/.jfd</strong>: Test form that uses an XML
resource bundle.</li>
<li><strong>I18nXmlExample.xml</strong>: XML resource bundle.</li>
<li><strong>XMLResourceBundle.java</strong>: Resource bundle class that reads
XML properties files.</li>
</ul>
<h2>Package com.jformdesigner.examples.propertyeditors</h2>
<p>Examples for implementing property editors for complex property
values. Property editors are used in the JFormDesigner
<a href="https://www.formdev.com/jformdesigner/doc/ui/properties-view/">Properties</a>
view.</p>
<ul>
<li><strong>MyImmutablePropertyData.java</strong>: This is an immutable custom
type used as property values. Immutable means that it has no methods to
modify its value.</li>
<li><strong>MyImmutablePropertyDataEditor.java</strong>: Property editor for <code>MyImmutablePropertyData</code>.
This property editor demonstrates how to build a custom editor and how
to update the property values on changes.</li>
<li><strong>MyPropertyData.java</strong>: This is a (mutable) custom type used
as property values. Mutable means that it has setter methods to modify
its value.</li>
<li><strong>MyPropertyDataEditor.java</strong>: Property editor for <code>MyPropertyData</code>.
This property editor demonstrates how to build a custom editor and how
to update the property values on changes.</li>
<li><strong>PropertyEditorTestBean.java</strong>: This is a (non-visual) bean
to test the property editors. It uses <code>MyPropertyData</code> and <code>MyImmutablePropertyData</code>.
Use &quot;Choose Bean&quot; in JFormDesigner to add it to a form.</li>
<li><strong>PropertyEditorTestForm.java/.jfd</strong>: Test form for property
editors.</li>
</ul>
<p><br />
Copyright &copy; 2004-2023 FormDev Software GmbH. All rights reserved.</p>

</div>
</body>

</html>
